https://glot.io/snippets/gidyr9j8d1/raw/main.lua